package org.flowers.unbeaten.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.flowers.unbeaten.base.entity.BaseEntity;
import org.flowers.unbeaten.base.entity.Log;
import org.flowers.unbeaten.mapper.LogMapper;
import org.flowers.unbeaten.service.ILogService;
import org.flowers.unbeaten.util.PageUtils;
import org.flowers.unbeaten.util.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 日志 服务实现类
 * </p>
 *
 * @author RyanWang
 * @since 2021-07-16
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements ILogService {

    @Autowired
    private LogMapper logMapper;

    @Override
    public PageVo<Log> getLogPageList(Log log, BaseEntity baseEntity) {
        PageHelper.startPage(baseEntity.getPage(), baseEntity.getLimit());
        List<Log> logs = logMapper.selectLogs(log);
        return PageUtils.getPageVo(logs);
    }
}
